var api = require("../../api.js"), app = getApp();
// var WxParse = require('../../wxParse/wxParse.js');
var app = getApp();

Page({

    /**
     * 页面的初始数据
     */
    data: {
        eng_list:['A','B','C','D','E','F','G','H',"I",'J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],


        // id
        curNav:'A'
    },
    // choose series
    detail_car :function(t){
        console.log(t.currentTarget.dataset.car_name);
        let car_name= t.currentTarget.dataset.car_name;
        wx.redirectTo({
            url: '/pages/choose_model/choose_model?car_name=' + car_name,
        })
    },
    // english
    english:function(t){
        console.log(t)
        console.log(t.currentTarget.dataset.name)
        let eng = t.currentTarget.dataset.name;
        let that = this;
        that.setData({
            scrollId: eng,
            curNav: eng,
        })
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        // 拿到上一页传过来的 id
        let that = this;
        app.request({
            url: api.car.series,
            data: {},
            method: 'GET',
            success: function(res) {
                console.log(res)
                that.setData({
                    series:res
                })
            },
            fail: function(res) {},
            complete: function(res) {},
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {
        console.log(wx.getSystemInfoSync().windowHeight)
        let that = this;
        that.setData({
            winH: wx.getSystemInfoSync().windowHeight
        })
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    }
})